package com.yaoayao.mall.activity.controller;

import com.yaoayao.mall.activity.service.ActivityService;
import com.yaoayao.mall.model.activity.SeckillGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/activity/seckill")
public class ActivityController {

    @Autowired
    private ActivityService activityService;

    @GetMapping("/findAll")
    public List<SeckillGoods> findAll(){
        return activityService.findAll();
    }

    //秒杀详情页
    @GetMapping("/findBySkuId/{skuId}")
    public SeckillGoods findBySkuId(@PathVariable Long skuId){
        return activityService.findBySkuId(skuId);
    }
}
